<?xml version="1.0"?>
<sequence version="3.00" name="Post OS Installation Task Sequence" description="A task sequence for configuring an Operating System after install">
  <group name="Configure INET1" disable="false" continueOnError="false" description="" expand="true">
    <step type="SMS_TaskSequence_RunCommandLineAction" name="Rearm Windows" description="" disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
      <defaultVarList>
        <variable name="PackageID" property="PackageID" />
        <variable name="RunAsUser" property="RunAsUser">false</variable>
        <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
        <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
        <variable name="LoadProfile" property="LoadProfile">false</variable>
      </defaultVarList>
      <action>cscript C:\Windows\System32\slmgr.vbs -rearm</action>
      <condition>
        <operator type="and">
          <expression type="SMS_TaskSequence_VariableConditionExpression">
            <variable name="Variable">RearmWindows</variable>
            <variable name="Operator">equals</variable>
            <variable name="Value">YES</variable>
          </expression>
        </operator>
      </condition>
    </step>
    <step type="BDD_RunPowerShellAction" name="Set Desktop Background" description="" disable="false" continueOnError="false" successCodeList="0 3010">
      <defaultVarList>
        <variable name="ScriptName" property="ScriptName">%SCRIPTROOT%\ZTIDesktopBackground.ps1</variable>
        <variable name="Parameters" property="Parameters"></variable>
        <variable name="PackageID" property="PackageID" />
      </defaultVarList>
      <action>cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf</action>
      <condition>
        <operator type="and">
          <expression type="SMS_TaskSequence_VariableConditionExpression">
            <variable name="Variable">SetDesktopBackground</variable>
            <variable name="Operator">equals</variable>
            <variable name="Value">YES</variable>
          </expression>
        </operator>
      </condition>
    </step>
    <step type="SMS_TaskSequence_SetVariableAction" name="Set Phase" description="" disable="false" continueOnError="false" successCodeList="0 3010">
      <defaultVarList>
        <variable name="VariableName" property="VariableName">PHASE</variable>
        <variable name="VariableValue" property="VariableValue">STATERESTORE</variable>
      </defaultVarList>
      <action>cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"</action>
    </step>
    <step type="BDD_Gather" name="Gather INET1" disable="false" continueOnError="false" successCodeList="0 3010" description="" startIn="">
      <defaultVarList>
        <variable name="GatherLocalOnly" property="GatherLocalOnly">false</variable>
        <variable name="RulesFile" property="RulesFile">INET1.INI</variable>
      </defaultVarList>
      <action>cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"</action>
    </step>
    <step type="SMS_TaskSequence_RunCommandLineAction" name="Disable Server Manager at Startup" description="" disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
      <defaultVarList>
        <variable name="PackageID" property="PackageID" />
        <variable name="RunAsUser" property="RunAsUser">false</variable>
        <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
        <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
        <variable name="LoadProfile" property="LoadProfile">false</variable>
      </defaultVarList>
      <action>cmd.exe /c REG ADD HKLM\Software\Microsoft\ServerManager /v DoNotOpenServerManagerAtLogon /t REG_DWORD /d 1 /f</action>
    </step>
    <group expand="true" name="Configure TCP/IP." description="" disable="false" continueOnError="false">
      <step type="BDD_RunPowerShellAction" name="Reset Local Administrator Password" description="" disable="false" continueOnError="false" successCodeList="0 3010">
        <defaultVarList>
          <variable name="ScriptName" property="ScriptName">%SCRIPTROOT%\ZTIReset-AdministratorPassword.ps1</variable>
          <variable name="Parameters" property="Parameters">-Password $TSEnv:AdminPassword</variable>
          <variable name="PackageID" property="PackageID" />
        </defaultVarList>
        <action>cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf</action>
      </step>
      <action />
      <step type="SMS_TaskSequence_ApplyNetworkSettingsAction" name="Apply Network Settings" disable="false" continueOnError="false" successCodeList="0" description="" startIn="">
        <action>cscript.exe "%SCRIPTROOT%\ZTINICConfig.wsf"</action>
        <defaultVarList>
          <variable name="OSDAdapterCount" property="NumAdapters">0</variable>
          <variable name="OSDAdapter" property="Adapters">0</variable>
        </defaultVarList>
      </step>
      <step name="Tattoo" disable="false" continueOnError="true" successCodeList="0 3010" description="" startIn="">
        <action>cscript.exe "%SCRIPTROOT%\ZTITatoo.wsf"</action>
        <defaultVarList>
          <variable name="RunAsUser" property="RunAsUser">false</variable>
          <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
          <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
          <variable name="LoadProfile" property="LoadProfile">false</variable>
        </defaultVarList>
      </step>
    </group>
    <group expand="true" name="Rename the computer" description="" disable="false" continueOnError="false">
      <action />
      <step type="BDD_RunPowerShellAction" name="Rename Computer" description="" disable="false" continueOnError="false" successCodeList="0 3010">
        <defaultVarList>
          <variable name="ScriptName" property="ScriptName">%SCRIPTROOT%\ZTIRename-Computer.ps1</variable>
          <variable name="Parameters" property="Parameters">-Name $TSEnv:OSDComputerName -WorkgroupName $TSEnv:JoinWorkgroup</variable>
          <variable name="PackageID" property="PackageID" />
        </defaultVarList>
        <action>cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf</action>
        <condition />
      </step>
      <step type="SMS_TaskSequence_RebootAction" name="Restart computer" description="" disable="false" continueOnError="false" runIn="WinPEandFullOS" successCodeList="0 3010">
        <defaultVarList>
          <variable name="SMSRebootMessage" property="Message" />
          <variable name="SMSRebootTimeout" property="MessageTimeout">60</variable>
          <variable name="SMSRebootTarget" property="Target" />
        </defaultVarList>
        <action>smsboot.exe /target:WinPE</action>
      </step>
    </group>
    <group expand="true" name="Install the Web Server (IIS) and DNS server roles" description="" disable="false" continueOnError="false">
      <action />
      <step type="BDD_InstallRoles" name="Install Roles and Features" description="" disable="false" continueOnError="false" runIn="WinPEandFullOS" successCodeList="0 3010">
        <defaultVarList>
          <variable name="OSRoleIndex" property="OSRoleIndex">5</variable>
          <variable name="OSRoles" property="OSRoles"></variable>
          <variable name="OSRoleServices" property="OSRoleServices"></variable>
          <variable name="OSFeatures" property="OSFeatures"></variable>
        </defaultVarList>
        <action>cscript.exe "%SCRIPTROOT%\ZTIOSRole.wsf"</action>
      </step>
    </group>
    <group name="Create DNS Records" disable="false" continueOnError="false" expand="true" description="">
      <step type="BDD_ConfigureDNS" name="Configure DNS" description="" disable="false" continueOnError="false" runIn="WinPEandFullOS" successCodeList="0 3010">
        <defaultVarList>
          <variable name="DNSServerOptionDisableRecursion" property="DNSServerOptionDisableRecursion">false</variable>
          <variable name="DNSServerOptionBINDSecondaries" property="DNSServerOptionBINDSecondaries">false</variable>
          <variable name="DNSServerOptionFailOnLoad" property="DNSServerOptionFailOnLoad">false</variable>
          <variable name="DNSServerOptionEnableRoundRobin" property="DNSServerOptionEnableRoundRobin">true</variable>
          <variable name="DNSServerOptionEnableNetmaskOrdering" property="DNSServerOptionEnableNetmaskOrdering">true</variable>
          <variable name="DNSServerOptionEnableSecureCache" property="DNSServerOptionEnableSecureCache">true</variable>
          <variable name="DNSServerOptionNameCheckFlag" property="DNSServerOptionNameCheckFlag">2</variable>
          <variable name="DNSZones" property="DNSZones">0</variable>
        </defaultVarList>
        <action>cscript.exe "%SCRIPTROOT%\ZTIConfigureDNS.wsf"</action>
      </step>
      <step type="BDD_RunPowerShellAction" name="Add DNS Records" description="" disable="false" continueOnError="false" successCodeList="0 3010">
        <defaultVarList>
          <variable name="ScriptName" property="ScriptName">%SCRIPTROOT%\ZTIAddDNSRecords.ps1</variable>
          <variable name="Parameters" property="Parameters">-Record $tsenvlist:INET1DNSRecord</variable>
          <variable name="PackageID" property="PackageID" />
        </defaultVarList>
        <action>cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf</action>
      </step>
      <step type="SMS_TaskSequence_RebootAction" name="Restart computer" description="" disable="false" continueOnError="false" runIn="WinPEandFullOS" successCodeList="0 3010">
        <defaultVarList>
          <variable name="SMSRebootMessage" property="Message" />
          <variable name="SMSRebootTimeout" property="MessageTimeout">60</variable>
          <variable name="SMSRebootTarget" property="Target" />
        </defaultVarList>
        <action>smsboot.exe /target:WinPE</action>
      </step>
    </group>
    <group expand="true" name="Install and configure the DHCP server role on INET1" description="" disable="false" continueOnError="false">
      <step type="BDD_RunPowerShellAction" name="Configure DHCP Service" description="" disable="false" continueOnError="false" successCodeList="0 3010">
        <defaultVarList>
          <variable name="ScriptName" property="ScriptName">%SCRIPTROOT%\ZTIConfigure-DHCP-Service.ps1</variable>
          <variable name="Parameters" property="Parameters">-Name "DHCP users" -Description "DHCP user group"</variable>
          <variable name="PackageID" property="PackageID" />
        </defaultVarList>
        <action>cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf</action>
      </step>
      <step type="BDD_ConfigureDHCP" name="Configure DHCP Server" description="" disable="false" continueOnError="false" runIn="WinPEandFullOS" successCodeList="0 3010">
        <defaultVarList>
          <variable name="DHCPServerOptionRouter" property="DHCPServerOptionRouter"></variable>
          <variable name="DHCPServerOptionDNSServer" property="DHCPServerOptionDNSServer"></variable>
          <variable name="DHCPServerOptionWINSServer" property="DHCPServerOptionWINSServer"></variable>
          <variable name="DHCPServerOptionDNSDomainName" property="DHCPServerOptionDNSDomainName"></variable>
          <variable name="DHCPServerOptionNBTNodeType" property="DHCPServerOptionNBTNodeType"></variable>
          <variable name="DHCPServerOptionPXEClient" property="DHCPServerOptionPXEClient"></variable>
          <variable name="DHCPScopes" property="DHCPScopes">0</variable>
        </defaultVarList>
        <action>cscript.exe "%SCRIPTROOT%\ZTIConfigureDHCP.wsf"</action>
      </step>
      <action />
    </group>
    <group expand="true" name="Configure the NCSI web site" description="" disable="false" continueOnError="false">
      <step type="SMS_TaskSequence_RunCommandLineAction" name="Configure NCSI web site" description="" disable="false" continueOnError="false" startIn="" successCodeList="0 3010" runIn="WinPEandFullOS">
        <defaultVarList>
          <variable name="PackageID" property="PackageID"></variable>
          <variable name="RunAsUser" property="RunAsUser">false</variable>
          <variable name="SMSTSRunCommandLineUserName" property="SMSTSRunCommandLineUserName"></variable>
          <variable name="SMSTSRunCommandLineUserPassword" property="SMSTSRunCommandLineUserPassword"></variable>
          <variable name="LoadProfile" property="LoadProfile">false</variable>
        </defaultVarList>
        <action>cmd.exe /c Echo Microsoft NCSI&gt; C:\inetpub\wwwroot\ncsi.txt</action>
      </step>
      <action />
    </group>
  </group>
</sequence>